package pqt;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.SwingConstants;
import java.awt.Toolkit;

public class Dialogo extends JDialog {

	private final JPanel contentPanel = new JPanel();
	JLabel texto = new JLabel("");
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		try {
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the dialog.
	 */
	public Dialogo(final Paneles padre, final JPanel panel,String g) {
		
		
		//setModal(true);
		//setIconImage(Toolkit.getDefaultToolkit().getImage(Dialogo.class.getResource("/img/icono.png")));
		//setTitle("MENSAJE");
		panel.setLayout(new BorderLayout());
		panel.setBorder(new EmptyBorder(5, 5, 5, 5));
		panel.setLayout(null);
		texto.setHorizontalAlignment(SwingConstants.CENTER);
		
		
		texto.setBounds(10, 25, 381, 102);
		texto.setFont(new Font("Tahoma", Font.PLAIN, 40));
		texto.setText("<html><p align='center'>"+g +"</p></html>");
		panel.add(texto);
		
		
		JButton btnAceptar = new JButton("Aceptar");
		btnAceptar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				panel.removeAll();
				padre.siguienteEnsayo(2);
				
			}
		});
		btnAceptar.setBounds(153, 120, 89, 23);
		
		getRootPane().setDefaultButton(btnAceptar);
		panel.add(btnAceptar);
		
	}
}
